package weekendpractice.AnimalZoo;

public class AniTest {
    public static void main(String[] args) {
        Animal[] ani = new Animal[4];
        ani[0] = new Dog(1, "Bob", "brown");
        ani[1] = new Chicken(1, "Lee", "red");
        ani[2] = new Fish(1, "Mouse", "blue");
        ani[3] = new Turtle(1, "Kris", "green");
//        for (int i = 0; i < ani.length; i++) {
//            ani[i].eat();
//            ani[i].drink();
//        }
        for (int i = 0; i < ani.length; i++) {
            if (ani[i] instanceof Dog){
                Dog g=(Dog)ani[i];
                g.lookHouse();
                g.swim();
            }else if (ani[i] instanceof Chicken){
                Chicken c=(Chicken)ani[i];
                c.layEggs();
            }else if (ani[i] instanceof Fish){
                Fish f=(Fish)ani[i];
                f.swim();
            }else if (ani[i] instanceof Turtle){
                Turtle t=(Turtle)ani[i];
                t.layEggs();
                t.swim();
            }

        }
    }
}
